from django.db import models
from django.contrib.auth.models import AbstractUser
#自定义用户模型，对django原有的用户模型进行字段添加

class User(AbstractUser):
    phone = models.CharField(max_length=15,unique=True,verbose_name='用户手机号')
    avatar = models.ImageField(max_length=255,null=True,blank=True,verbose_name='用户头像')

    class Meta:
        db_table = 't_users'
        verbose_name = '用户模型'
        verbose_name_plural = verbose_name